package com.example.demo.controller;

import com.example.demo.domain.Question;
import com.example.demo.dto.UserInfoResponse;
import com.example.demo.service.DingService;
import com.example.demo.service.IDingService;
import com.example.demo.service.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DingController {

    @Autowired
    private IDingService iDingService;


    @GetMapping("/getToken")
    public Response<UserInfoResponse> getDingToken(@RequestParam("code") String code)
    {
        UserInfoResponse userInfo = iDingService.getDingToken(code);
        return  Response.newSuccess(userInfo);
    }

}
